using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEngine;

#pragma warning disable CS0162

namespace HEFramework
{
    /// <summary>
    ///
    /// 代码加载器
    /// 
    /// ----------------------------------------
    /// 作者 hep
    /// 创建时间：2023-11-29 16:22:09
    /// ----------------------------------------
    /// </summary>
    public class CodeLoader : Singleton<CodeLoader>, ISingletonAwake
    {
        public void Awake()
        {
            //读取程序集
            World.Instance.AddSingleton<CodeOwner, Assembly[]>(new[] { typeof(World).Assembly });
            CodeOwner.Instance.CreateCodeSingleton();
        }

        public void Reload()
        {
            World.Instance.AddSingleton<CodeOwner, Assembly[]>(new[] { typeof(World).Assembly });
            CodeOwner.Instance.CreateCodeSingleton();
        }
    }
}